{meta_html js $j_basepath.'design/back/js/jquery.ui.core.js'}
{meta_html js $j_basepath.'design/back/js/jquery.ui.widget.js'}
{meta_html js $j_basepath.'design/back/js/jquery.ui.mouse.js'}
{meta_html js $j_basepath.'design/back/js/jquery.ui.sortable.js'}
{assign $idversion = 0}

 <p><a style="margin-right:68px;" href="{jurl 'essais~BoFiches:index', array('iTypeId'=>1)}" class="bt_green"><span class="bt_green_lft"></span><strong>Retour à la liste</strong><span class="bt_green_r"></span></a></p>
                <p style="width:100%;clear:both;"><strong><H1>MODELE</H1></strong></p>

<p style="width:100%;clear:both;"><h1>{$essai->marque_libelle} {$essai->modele_libelle} {$essai->ess_zVersion}</h1></p>

<div id="gammeMenu">

    <ul>
        <li><a class="c1" href="{jurl 'essais~BoModele:index', array('iId'=>$iId), false}">Chapeau</a></li>
        <li><a class="c1" href="{jurl 'essais~BoModele:chapitre', array('iId'=>$iId,'type'=>1), false}">Chapitres</a>
            <ul id ="sortablechapitre">
            {foreach $chapitre as $item}
                <li class="chap" title="Glisser pour ré ordonner" id="tiChapitreIds_{$item->chap_id}" class="ui-state-default"><a class="c2 first" href="{jurl 'essais~BoModele:chapitre', array('iId'=>$item->ess_id,'chap_name_id'=>$item->chap_name_id,'type'=>1,'iTypeId'=>1), false}" >{$item->name}</a><a href="{jurl 'essais~BoModele:supprChapitre', array('chapId'=>$item->chap_id, 'essaiId'=>$iId)}" class="ask" style="float:right;"><img src="{$j_basepath}design/back/img/user_logout.png" alt=""></a>
                {if sizeof($item->img)}
                    <ul>
                    {foreach $item->img as $imgItem}
                        {if $imgItem}
                        <li><a href="javascript:void(0)" onclick="document.getElementById('light').style.display='block';document.getElementById('fade').style.display='block'" id="{$imgItem}" class="img-pop">{$imgItem|basename}</a></li>  
                        {/if}
                    {/foreach}
                    </ul>
                {/if}
                </li>
            {/foreach}
            </ul>
        </li>
        <li><a class="c1" href="{jurl 'essais~BoModele:concurrence', array('iId'=>$iId), false}">Concurrences</a>
        {if isset($sh) && $sh}
              <ul id="sortable">
                  {foreach $concurrence as $item}
                    <li title="Glisser pour ré ordonner" id="tiMarqueIds_{$item->concur_id}" class="ui-state-default">  <a title="Editer" href="{jurl 'essais~BoModele:concurrence', array('iId'=>$iId,'concurrenceId'=>$item->concur_id), false}"><label>{$item->concur_name}</label></a>
                    <a href="{jurl 'essais~BoModele:supprConcurrence', array('concur_id'=>$item->concur_id,'iId'=>$iId)}" class="ask" style="float:right; "><img src="{$j_basepath}design/back/img/user_logout.png" alt=""></a></li> 
                  {/foreach}
               </ul>
         {/if}
        </li>

		<li><a class="c1" href="{jurl 'essais~BoModeleSuperBof:index', array('iId'=>$iId), false}">Super / Bof</a></li>
        <li><a class="c1" href="{jurl 'essais~BoModeleRappel:index', array('iId'=>$iId,'iTypeId'=>1), false}">Fiabilité</a></li>
        <li><a class="c1" href="{jurl 'essais~BoModeleRappel:index', array('iId'=>$iId,'iTypeId'=>2), false}">Rappel</a></li>
        <li><a class="c1" href="{jurl 'essais~BoModeleRappel:index', array('iId'=>$iId,'iTypeId'=>3), false}">Equipement</a></li>
        <li><a class="c1" href="{jurl 'essais~BoModeleTechnique:techniques', array('iId'=>$iId), false}">Technique</a></li>
        <li><a class="c1" href="{jurl 'essais~BoModele:chapitre', array('iId'=>$iId,'type'=>2), false}">MEILLEURES VERSIONS</a>
         <ul id ="sortableversion">
            {foreach $version as $item}
                <li class="chap" title="Glisser pour ré ordonner" id="tiVersionIds_{$item->chap_id}" class="ui-state-default"><a class="c2 first" href="{jurl 'essais~BoModele:chapitre', array('iId'=>$item->ess_id,'chap_name_id'=>$item->chap_name_id,'type'=>2,'iTypeId'=>1), false}" >{$item->name}</a><a href="{jurl 'essais~BoModele:supprChapitre', array('chapId'=>$item->chap_id, 'essaiId'=>$iId)}" class="ask" style="float:right;"><img src="{$j_basepath}design/back/img/user_logout.png" alt=""></a>
                {if sizeof($item->img)}
                    <ul>
                    {foreach $item->img as $imgItem}
                        <li><a href="javascript:void(0)" onclick="document.getElementById('light').style.display='block';document.getElementById('fade').style.display='block'" id="{$imgItem}" class="img-pop">{$imgItem|basename}</a></li>  
                    {/foreach}
                    </ul>
                {/if}
                </li>
            {/foreach}
            </ul>
        </li>


        <li> </li>
    </ul>
</div>
<div id="light" class="white_content">
        <a class="close" href = "javascript:void(0)" onclick = "document.getElementById('light').style.display='none';document.getElementById('fade').style.display='none'">Fermer</a>
            <div class="apercu1" id="apercu"><img src="" alt="" id="apecu-img"></div>
</div>
<div id="fade" class="black_overlay"></div>

{literal}

   <script type="text/javascript">
                $(function(){
                    $('.img-pop').click(function () {
                        image = $(this).attr('id')
                        $('#apecu-img').attr('src', image);
                    });
                });
   </script>

    <!-- script pour le tri ajax concurrence-->
    <script>
                    $(function() {
                        $( "#sortable" ).sortable({ opacity: 0.6, cursor: 'move', update: function() {
                                var order = $(this).sortable("serialize") ;
                                $.post("{/literal}{jurl 'essais~BoModele:reOrderConcurrence', array(), false}{literal}", order);
                            }
                        });
                        $( "#sortable" ).disableSelection();
                    });
    </script> 
    
      <!-- script pour le tri ajax chapitre-->
    <script>
                    $(function() {
                        $( "#sortablechapitre" ).sortable({ opacity: 0.6, cursor: 'move', update: function() {
                                var order = $(this).sortable("serialize") ;
                                $.post("{/literal}{jurl 'essais~BoModele:reOrderChapitre', array(), false}{literal}", order);
                            }
                        });
                        $( "#sortablechapitre" ).disableSelection();
                    });
    </script> 
    
          <!-- script pour le tri ajax version-->
    <script>
                    $(function() {
                        $( "#sortableversion" ).sortable({ opacity: 0.6, cursor: 'move', update: function() {
                                var order = $(this).sortable("serialize") ;
                                $.post("{/literal}{jurl 'essais~BoModele:reOrderVersion', array(), false}{literal}", order);
                            }
                        });
                        $( "#sortableversion" ).disableSelection();
                    });
    </script>       

    <style type="text/css">
    #sortable label {position:relative;left:15px;} 
    </style>
{/literal}
